﻿
<div id="grid_Bank_water_@ViewBag.BankID"></div>

<script class="grid_Bank_water">
    $(function () { 
        $("#grid_Bank_water_@ViewBag.BankID").kendoGrid({
            columns: [{
                title: "单据号",
                field: "OrderNo",
                template: "#=OrderOperations(OrderNo)#",
                width: 130
            }, {
                title: "客户",
                field: "Customer.ComplexName",
                width: 200
            }, {
                title: "金额",
                field: "Money",
                format: "{0:c}",
                width: 100
            }, {
                title: "备注",
                field: "Description",
                width: 200
            }, {
                title: "日期",
                template: "#=kendo.toString(kendo.parseDate(NoteDate),'yyyy-MM-dd')#",
                width: 100
            }, {}],
            dataSource: Whale.dataSource({
                url: "/Financial/Payment/GetBankWater",
                getParameters: function () {
                    return {
                        getCustomer: true,
                        BankID: "@ViewBag.BankID"
                    };
                },
                pageSize: 20

            }),
            pageable: {
                messages: {
                    empty: "暂无数据"
                }
            },
            dataBound: function (e) {
                //让表头居中
                $("th.k-header").attr("style", "text-align:center; font-weight:bold;");
            }
        });
    });
    function OrderOperations(orderNo) {
        var html = "";
        if (orderNo != null)
            html = "<a href=\"javascript:ShowPaidOrder('" + orderNo + "')\">" + orderNo + "</a>";
        return html;
    }

    function ShowPaidOrder(orderNo) {
        if (wndGeneralEdit != null && typeof wndGeneralEdit != "undefined") {
            wndGeneralEdit.setOptions({ title: "单据详情", width: 800 });
            var url = "/Orders/PaidOrder/Order/";
            wndGeneralEdit.refresh({ url: url + orderNo });
            wndGeneralEdit.open();
        }
    }
</script>